﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="OpenWaves.EPiServer.AdminTools.LogViewer.UI.LogFileListing" EnableViewState="false" %>

<%@ Import Namespace="OpenWaves" %>
<%@ Import Namespace="OpenWaves.EPiServer.AdminTools.LogViewer.UI" %>
<%@ Register Assembly="OpenWaves.EPiServer" Namespace="OpenWaves.EPiServer.AdminTools.LogViewer.UI" TagPrefix="lv" %>

<asp:Content ContentPlaceHolderID="FullRegion" runat="server"> 
     <div class="EP-systemContainer">
        <h1><%= TranslateFallback("header", "Log viewer")%> </h1>    
        <span class="EP-systemInfo"><%= TranslateFallback("intro", "Log files from directories configured in web.config are displayed below.") %></span>
    </div>
    
    <lv:LogDirectoryRepeater runat=server DataSource=<%# Directories %>>
        <NoResultsTemplate>
            <%= Html.Encode(TranslateFallback("noDirectories", "No directories found. Setup log directories in web.config (<makingWaves.Common.EPiServer logDirectories=\"...\"/>) and ensure they are accesible."))%> 
        </NoResultsTemplate>            
        <ItemTemplate>            
            <div><h3 style="display:inline"><%# Container.Item.Name %></h3> (<%# Container.Item.Path %>)</div>
                
                 <table class="epistandardtable" cellspacing="0" border="0" style="border-style: none; border-collapse: collapse;">
                    <tbody>
                        <tr>
                            <td class="epitableheading"><%# Html.Encode(TranslateFallback("fileName", "File name"))%></td>                                     
                            <td class="epitableheading"><%# Html.Encode(TranslateFallback("lastModified", "Last modified"))%></td>                                     
                            <td class="epitableheading"><%# Html.Encode(TranslateFallback("size", "Size"))%></td> 
                            <td class="epitableheading">&nbsp;</td>
                        </tr>                               
                            
                        <lv:LogFileRepeater runat=server DataSource=<%# Container.Item.Files %>>                        
                            <ItemTemplate>
                                <tr>
                                    <td>
                                        <%# Html.Encode(Container.Item.Name) %>                                                              
                                    </td>
                                    <td>
                                        <%# Container.Item.LastModified %>
                                    </td>
                                    <td>
                                        <%# Container.Item.Size.ToString() %>
                                    </td>
                                    <td>
                                       <a href="<%#  GetViewUrl(Container.Item) %>" runat="server">
                                        <img src='<%= GetImageThemeUrl("Tools/ViewMode.gif") %>' title='<%= TranslateFallback("view","View")%>' />
                                       </a>                     
                                       <a id="A1" href="<%#  GetDownloadUrl(Container.Item) %>" runat="server">
                                        <img src='<%= this.GetWebResourceImageUrl("Download.gif") %>' title='<%= TranslateFallback("download","Download")%>' />
                                       </a>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </lv:LogFileRepeater> 
                    </tbody>
                </table>                           
        
        </ItemTemplate>
    </lv:LogDirectoryRepeater>          
</asp:Content>
